package com.keyinong.caizhengting.activity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebView;
import android.widget.ImageButton;

import com.keyinong.caizhengting.R;

/**
 * @author：郑谦
 * @时间：2017-4-10 下午4:02:27
 * @类名：NewxiaotieshiActivity.java
 * @功能: 小贴士详情
 */

public class NewxiaotieshiActivity extends Activity {

    String id;
    private ImageButton ib_back;
    private WebView vb;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            getWindow().addFlags(
                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//			getWindow().addFlags(
//					WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        }
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_newxiaotieshi);
        initRes();
    }

    @SuppressLint("SetJavaScriptEnabled")
    private void initRes() {
        ib_back = (ImageButton) findViewById(R.id.ib_back);
        vb = (WebView) findViewById(R.id.webView1);
        vb.getSettings().setJavaScriptEnabled(true);
        vb.getSettings().setDomStorageEnabled(true);
        id = getIntent().getStringExtra("id");
        String url = "http://dcapi.kinontech.com/index.php/home/articleDetail/id/" + id;
        vb.loadUrl(url);
        ib_back.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

}
